package leetcode_400;

import java.util.Iterator;
import java.util.List;
import java.util.Stack;
import java.util.Vector;

public class FlattenNestedListIterator_341 implements Iterable<Integer> {
	Stack<FlattenNestedListIterator_341> stack = new Stack<FlattenNestedListIterator_341>();

	public FlattenNestedListIterator_341(List<FlattenNestedListIterator_341> nestedList) {
		for (int n = nestedList.size() - 1; n >= 0; n--) {
			stack.push(nestedList.get(n));
		}
	}

	@Override
	public Iterator<Integer> iterator() {
		// TODO Auto-generated method stub
		return null;
	}

	public Integer next() {
		if (hasNext())
			return stack.pop().getInteger();
		else
			return null;
	}

	private Integer getInteger() {
		// TODO Auto-generated method stub
		return null;
	}

	public boolean hasNext() {
		while (!stack.isEmpty()) {
			if (stack.peek().isInteger()) {
				return true;
			} else {
				FlattenNestedListIterator_341 tempNested = stack.pop();
				for (int n = tempNested.getList().size() - 1; n >= 0; n--) {
					stack.push(tempNested.getList().get(n));
				}
			}
		}
		return false;
	}

	private Vector<FlattenNestedListIterator_341> getList() {
		// TODO Auto-generated method stub
		return null;
	}

	private boolean isInteger() {
		// TODO Auto-generated method stub
		return false;
	}
}
